package tu.test;

import tu.cityInfor.CityInformation;

public class Demo_2 {
    public static void main(String[] args) throws Exception {
        Object[] temp ={"成都","重庆","武汉","贵阳","昆明","南昌","北京","长沙","上海","杭州","南京","郑州","西安","兰州"};
        int[] time ={10,20,10,10,10,10,10,10,10,20,30,20,10,20};
        for (int i = 0; i < time.length; i++) {
            if(time[i] < 0){
                throw new Exception("输入时间错误");
            }
        }
        CityInformation city = new CityInformation();
        city.create1(temp, time);
        city.display();
        System.out.println("================");
        // city.insert2("石家庄", -20);
        city.insert2("石家庄", 20);
        city.display();
        // city.remove(-1);
        System.out.println("被删除的城市为"+city.remove(2));
        city.display();
    }
}
